package com.bookcity.front.webfront.service.impl;

import com.bookcity.front.webfront.domain.Promotion;
import com.bookcity.front.webfront.mapper.PromotionMapper;
import com.bookcity.front.webfront.service.IPromotionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 推广码Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-05-09
 */
@Service
public class PromotionServiceImpl implements IPromotionService 
{
    @Autowired
    private PromotionMapper promotionMapper;

    /**
     * 查询推广码
     * 
     * @param id 推广码主键
     * @return 推广码
     */
    @Override
    public Promotion selectPromotionById(Integer id)
    {
        return promotionMapper.selectPromotionById(id);
    }

    /**
     * 查询推广码列表
     * 
     * @param promotion 推广码
     * @return 推广码
     */
    @Override
    public List<Promotion> selectPromotionList(Promotion promotion)
    {
        return promotionMapper.selectPromotionList(promotion);
    }

    /**
     * 新增推广码
     * 
     * @param promotion 推广码
     * @return 结果
     */
    @Override
    public int insertPromotion(Promotion promotion)
    {
        return promotionMapper.insertPromotion(promotion);
    }

    /**
     * 修改推广码
     * 
     * @param promotion 推广码
     * @return 结果
     */
    @Override
    public int updatePromotion(Promotion promotion)
    {
        return promotionMapper.updatePromotion(promotion);
    }

    /**
     * 批量删除推广码
     * 
     * @param ids 需要删除的推广码主键
     * @return 结果
     */
    @Override
    public int deletePromotionByIds(Integer[] ids)
    {
        return promotionMapper.deletePromotionByIds(ids);
    }

    /**
     * 删除推广码信息
     * 
     * @param id 推广码主键
     * @return 结果
     */
    @Override
    public int deletePromotionById(Integer id)
    {
        return promotionMapper.deletePromotionById(id);
    }
}
